package com.qyhl.webtv.module_circle.circle.home;


import com.qyhl.webtv.commonlib.entity.circle.CircleHomeBean;

import java.util.List;

/**
 * Created by qyhl on 2018/1/17.
 */

public class CircleHomePresenter implements CircleHomeContract.CirclePresenter {
    private CircleHomeModel mModel;
    private CircleHomeFragment mView;

    public CircleHomePresenter(CircleHomeFragment mView) {
        this.mView = mView;
        this.mModel = new CircleHomeModel(this);
    }

    @Override
    public void getTopic() {
        mModel.getTopic();
    }

    @Override
    public void topicSuccess(List<CircleHomeBean.TagList> beanList) {
        mView.topicSuccess(beanList);
    }

    @Override
    public void topicError(int code, String msg) {
        switch (code) {
            case 0:
                mView.topicNetError(msg);
                break;
            case 1:
                mView.topicEmpty(msg);
                break;
            case 2:
                mView.topicError(msg);
                break;
            default:
                break;
        }
    }
}
